def build(bld):
  toolchain       = "codesourcery"
  
  comp_prefix     = bld.get_name_prefix(toolchain=toolchain)
  
  includes_netx10 = ["./netX10/includes"]
  sources_netx10  = ["./netX10/sources/common_func_netx10.c",
                     "./netX10/sources/initgnu.s"]
              
  includes_netx50 = ["./netX50/includes"]
  sources_netx50  = ["./netX50/sources/common_func_netx50.c",
                     "./netX50/sources/initgnu.s"]

  includes_netx51 = ["./netX51/includes"]
  sources_netx51  = ["./netX51/sources/common_func_netx51.c",
                     "./netX51/sources/initgnu.s"]                     

  includes_netx100 = ["./netX100/includes"]
  sources_netx100  = ["./netX100/sources/common_func_netx500.c",
                      "./netX100/sources/initgnu.s"]

  bld.stlib  ( name         = comp_prefix + "HAL_netx10",
               target       = "HAL_netX10",
               description  = "Common functions (netX10)",
               displaygroup = "Libraries",
               platform     = "netx10",
               toolchain    = toolchain, 
               source_arm   = sources_netx10,
               includes     = includes_netx10,
               defines      = ["NX10_SYSTIME_GetSystime=HAL_GetSystime",
                               "NX10_SYSTIME_SetBorder=HAL_SetSystimeBorder",
                               "NX10_UART_InitSerial=HAL_UartInit",
                               "NX10_UART_PutCharacter=HAL_UartPutChar"],
               export_includes = includes_netx10,
  )
  
  bld.stlib  ( name         = comp_prefix + "HAL_netx50",
               target       = "HAL_netX50",
               description  = "Common functions (netX50)",
               displaygroup = "Libraries",
               platform     = "netx50",
               toolchain    = toolchain, 
               source_arm   = sources_netx50,
               includes     = includes_netx50,
               defines      = ["NX50_SYSTIME_GetSystime=HAL_GetSystime",
                               "NX50_SYSTIME_SetBorder=HAL_SetSystimeBorder",
                               "NX50_UART_InitSerial=HAL_UartInit",
                               "NX50_UART_PutCharacter=HAL_UartPutChar"],
               export_includes = includes_netx50,
  )

  bld.stlib  ( name         = comp_prefix + "HAL_netx51",
               target       = "HAL_netX51",
               description  = "Common functions (netX51)",
               displaygroup = "Libraries",
               platform     = "netx51",
               toolchain    = toolchain, 
               source_arm   = sources_netx51,
               includes     = includes_netx51,
               defines      = ["NX51_SYSTIME_GetSystime=HAL_GetSystime",
                               "NX51_SYSTIME_SetBorder=HAL_SetSystimeBorder",
                               "NX51_UART_Init=HAL_UartInit",
                               "NX51_UART_PutCharacter=HAL_UartPutChar"],
               export_includes = includes_netx51, 
  )
  
  bld.stlib  ( name         = comp_prefix + "HAL_netx100",
               target       = "HAL_netX100",
               description  = "Common functions (netX100)",
               displaygroup = "Libraries",
               platform     = "netx100",
               toolchain    = toolchain, 
               source_arm   = sources_netx100,
               includes     = includes_netx100,
               defines      = ["NX500_SYSTIME_GetSystime=HAL_GetSystime",
                               "NX500_SYSTIME_SetBorder=HAL_SetSystimeBorder",
                               "NX500_UART_InitSerial=HAL_UartInit",
                               "NX500_UART_PutCharacter=HAL_UartPutChar"],
               export_includes = includes_netx100,              
  )  